const request=require("request")
const jsdom=require("jsdom")
const {JSDOM}=jsdom;
const fs=require("fs")

request({
    url:"https://i.y.qq.com/n2/m/share/details/taoge.html? ADTAG=newyqq.taoge&id=7256912512",
    method:"GET"
},(err,res,data)=>{
    const dom=new JSDOM(data,{runScripts:"dangerously"})
    let songList=JSON.stringify(dom.window.firstPageData)
    console.log(songList)
    fs.writeFile(`${__dirname}/detail.json`,songList,{
        encoding:"utf8"
    },(err)=>{
        if(!err) console.log
    })
})

